package com.icw.utility;

import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

public class PswdUtils {

	public static String encrypt(String originalPassword) {
		return bcypt.encode(originalPassword);
	}

	public static boolean validate(String originalPassword, String encryptedPassword) {
		return bcypt.matches(originalPassword, encryptedPassword);
	}

	private static BCryptPasswordEncoder bcypt = new BCryptPasswordEncoder(10);
}
